# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=erofs-utils
pkgver=1.3
pkgrel=1
pkgdesc="Userspace utilities for linux-erofs file system"
arch=('x86_64')
url="https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git"
license=('GPL2')
depends=('glibc' 'lz4')
makedepends=('util-linux')
source=("https://git.kernel.org/pub/scm/linux/kernel/git/xiang/${pkgname}.git/snapshot/${pkgname}-${pkgver}.tar.gz")
sha512sums=('6ddd8402dab80b0375b012ed51ff02b40cbeca9a4a1ba250b14ec6aeb97317ab575e315e9d4dc77ed1d7826c202396d9c0775917106ecbd7b4048168aca0fa6c')
b2sums=('1051cf387d059d71b91e0a940c86b819593902606ae4665a7801e9597dd72987385bee997d2d63b186c493557ee22118aff23161e48e25ee8f4859f9f6e46f14')

prepare() {
  cd "$pkgname-$pkgver"
  autoreconf -fiv
}

build() {
  cd "$pkgname-$pkgver"
  ./configure --prefix=/usr
  make
}

check() {
  cd "$pkgname-$pkgver"
  make -k check
}

package() {
  depends+=('libuuid.so')
  cd "$pkgname-$pkgver"
  make DESTDIR="$pkgdir/" install
  install -vDm 644 {AUTHORS,ChangeLog,README} -t "${pkgdir}/usr/share/doc/${pkgname}/"
}
